package com.xiweicheng.test.jpa;
// Generated 2018-7-14 9:20:43 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * TranslateItem generated by hbm2java
 */
@Entity
@Table(name = "translate_item", catalog = "tms")
public class TranslateItem implements java.io.Serializable {

	private Long id;
	private long version;
	private Language language;
	private Translate translate;
	private String content;
	private Date createDate;
	private String creator;
	private String status;
	private Date translateDate;
	private String translator;
	private Date updateDate;
	private String updater;
	private Set<TranslateItemHistory> translateItemHistories = new HashSet<TranslateItemHistory>(0);

	public TranslateItem() {
	}

	public TranslateItem(String status) {
		this.status = status;
	}

	public TranslateItem(Language language, Translate translate, String content, Date createDate, String creator,
			String status, Date translateDate, String translator, Date updateDate, String updater,
			Set<TranslateItemHistory> translateItemHistories) {
		this.language = language;
		this.translate = translate;
		this.content = content;
		this.createDate = createDate;
		this.creator = creator;
		this.status = status;
		this.translateDate = translateDate;
		this.translator = translator;
		this.updateDate = updateDate;
		this.updater = updater;
		this.translateItemHistories = translateItemHistories;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "language_id")
	public Language getLanguage() {
		return this.language;
	}

	public void setLanguage(Language language) {
		this.language = language;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "translate_id")
	public Translate getTranslate() {
		return this.translate;
	}

	public void setTranslate(Translate translate) {
		this.translate = translate;
	}

	@Column(name = "content")
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "creator")
	public String getCreator() {
		return this.creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "translate_date", length = 19)
	public Date getTranslateDate() {
		return this.translateDate;
	}

	public void setTranslateDate(Date translateDate) {
		this.translateDate = translateDate;
	}

	@Column(name = "translator")
	public String getTranslator() {
		return this.translator;
	}

	public void setTranslator(String translator) {
		this.translator = translator;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_date", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@Column(name = "updater")
	public String getUpdater() {
		return this.updater;
	}

	public void setUpdater(String updater) {
		this.updater = updater;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "translateItem")
	public Set<TranslateItemHistory> getTranslateItemHistories() {
		return this.translateItemHistories;
	}

	public void setTranslateItemHistories(Set<TranslateItemHistory> translateItemHistories) {
		this.translateItemHistories = translateItemHistories;
	}

}
